
#ifndef MANGA_UI_H
#define MANGA_UI_H

#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QDate>
#include <QPixmap>
#include<QMouseEvent>

class EventDisplayWidget : public QWidget
{
    Q_OBJECT

public:
    explicit EventDisplayWidget(QWidget *parent = nullptr);
    void setEvent(const QPixmap &image, const QString &theme, const QDate &date, const QString &description,
                  const QString &location, const QString &price, int productId);
    ~EventDisplayWidget();
    void mousePressEvent(QMouseEvent *event);

signals:
    void buyButtonClicked(const QString &title, const QString &price, int productId);
    void productClicked(const QPixmap &image, const QString &theme, const QString &description,
                        const QString &location,const QString &date, const QString &price, int productId);
private slots:
    void onBuyButtonClicked();

private:
    int productId;
    QLabel *imageLabel;
    QLabel *themeLabel;
    QLabel *dateLabel;
    QLabel *locationLabel;
    QLabel *priceLabel;
    QLabel *descriptionLabel;
    QPushButton *buyButton;
    QVBoxLayout *vBoxLayout;
    void setupUi();
};

#endif // MANGA_UI_H
